<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <title>IDCS Authentication Demo</title>

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-light bg-light">
  <span class="navbar-brand">IDCS Demo</span>
  <form class="form-inline" action="/login" method="get" hidden>
    <button id="login-btn" class="btn btn-primary" type="submit">Log In</button>
  </form>

  <form class="form-inline" action="/logout" method="get" hidden>
    <button id="logout-btn" class="btn btn-secondary" type="submit">Log Out</button>
  </form>
</nav>
<div class="container">
  <div class="jumbotron mt-3">
    <h1>IDCS Authentication Demo</h1>
    <p>This is an demo application that shows how to authenticate users and protect API routes via Oracle Identity Cloud Service.</p>
  </div>
    <div class="card">
        <div class="card-body">
            <h3 class="card-title">Employees</h3>
            <p id="unauthenticated-msg" hidden>Accessing employee information requires authentication. You are not authenticated 
              so you will not see any employee details. <a href="/api/employees" target="_blank" rel="noopener noreferrer">Click here</a> to manually test 
              the API endpoint.</p>
        </div>
        <div class="table-responsive">
            <table id="employees-tbl" class="table">
                <thead>
                <tr>
                    <th>Id</th>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Phone</th>
                    <th>Job</th>
                    <th>Salary</th>
                    <th>Commission</th>
                </tr>
                </thead>
                <tbody></tbody>
            </table>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="idcs-authentication-demo.js"></script>
</body>
</html>